package com.zy.drug.pojo;


import java.io.Serializable;
import java.math.BigDecimal;

import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;

/**
 * 
 * @TableName t_drug_info
 */
//@TableName(value ="t_drug_info")
@Data
public class DrugInfo implements Serializable {
    /**
     * 主键-自增id
     */
   // @TableId
    private Integer id;

    /**
     * 拼音
     */
    @ExcelProperty(index = 1,value = "编码")
    private String pinyin;

    /**
     * 药品名称
     */
    @ExcelProperty(index = 2,value = "药品名称")
    private String drugName;

    /**
     * 规格
     */
    @ExcelProperty(index = 4,value = "规格")
    private String specs;

    /**
     * 单位
     */
    @ExcelProperty(index = 9,value = "单位")
    private String unit;

    /**
     * 数量
     */
    private Integer num;

    /**
     * 价格
     */
    private BigDecimal price;

    /**
     * 备注
     */
    private String remarks;

    /**
     * 作用
     */
    private String functions;

    /**
     * 产地
     */
    @ExcelProperty(index = 3,value = "产地")
    private String origin;

    /**
     * 类型
     */
    private String type;

    /**
     * 毒性
     */
    private String toxicity;

    /**
     * 等级
     */
    @ExcelProperty(index = 5,value = "等级")
    private String degree;

    /**
     * 公斤价
     */
    private BigDecimal kilogramPrice;

    /**
     * 单斤价
     */
    private BigDecimal pricePerKilogram;

    /**
     * 克价
     */
    private BigDecimal pricePerGram;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DrugInfo other = (DrugInfo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getPinyin() == null ? other.getPinyin() == null : this.getPinyin().equals(other.getPinyin()))
            && (this.getDrugName() == null ? other.getDrugName() == null : this.getDrugName().equals(other.getDrugName()))
            && (this.getSpecs() == null ? other.getSpecs() == null : this.getSpecs().equals(other.getSpecs()))
            && (this.getUnit() == null ? other.getUnit() == null : this.getUnit().equals(other.getUnit()))
            && (this.getNum() == null ? other.getNum() == null : this.getNum().equals(other.getNum()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks()))
            && (this.getFunctions() == null ? other.getFunctions() == null : this.getFunctions().equals(other.getFunctions()))
            && (this.getOrigin() == null ? other.getOrigin() == null : this.getOrigin().equals(other.getOrigin()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getToxicity() == null ? other.getToxicity() == null : this.getToxicity().equals(other.getToxicity()))
            && (this.getDegree() == null ? other.getDegree() == null : this.getDegree().equals(other.getDegree()))
            && (this.getKilogramPrice() == null ? other.getKilogramPrice() == null : this.getKilogramPrice().equals(other.getKilogramPrice()))
            && (this.getPricePerKilogram() == null ? other.getPricePerKilogram() == null : this.getPricePerKilogram().equals(other.getPricePerKilogram()))
            && (this.getPricePerGram() == null ? other.getPricePerGram() == null : this.getPricePerGram().equals(other.getPricePerGram()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getPinyin() == null) ? 0 : getPinyin().hashCode());
        result = prime * result + ((getDrugName() == null) ? 0 : getDrugName().hashCode());
        result = prime * result + ((getSpecs() == null) ? 0 : getSpecs().hashCode());
        result = prime * result + ((getUnit() == null) ? 0 : getUnit().hashCode());
        result = prime * result + ((getNum() == null) ? 0 : getNum().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getRemarks() == null) ? 0 : getRemarks().hashCode());
        result = prime * result + ((getFunctions() == null) ? 0 : getFunctions().hashCode());
        result = prime * result + ((getOrigin() == null) ? 0 : getOrigin().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getToxicity() == null) ? 0 : getToxicity().hashCode());
        result = prime * result + ((getDegree() == null) ? 0 : getDegree().hashCode());
        result = prime * result + ((getKilogramPrice() == null) ? 0 : getKilogramPrice().hashCode());
        result = prime * result + ((getPricePerKilogram() == null) ? 0 : getPricePerKilogram().hashCode());
        result = prime * result + ((getPricePerGram() == null) ? 0 : getPricePerGram().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", pinyin=").append(pinyin);
        sb.append(", drugName=").append(drugName);
        sb.append(", specs=").append(specs);
        sb.append(", unit=").append(unit);
        sb.append(", num=").append(num);
        sb.append(", price=").append(price);
        sb.append(", remarks=").append(remarks);
        sb.append(", functions=").append(functions);
        sb.append(", origin=").append(origin);
        sb.append(", type=").append(type);
        sb.append(", toxicity=").append(toxicity);
        sb.append(", degree=").append(degree);
        sb.append(", kilogramPrice=").append(kilogramPrice);
        sb.append(", pricePerKilogram=").append(pricePerKilogram);
        sb.append(", pricePerGram=").append(pricePerGram);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}